<template>
	<view class="page">
		<view style="position: relative;">
			<view
				style="color: #FFFFFF;font-size: 28upx;z-index: 100;position: absolute;margin-left: 225upx;margin-top: 200upx;font-weight: bold;">
				一 认证技术 接单不停 一</view>
			<view>
				<image style="width: 100%;" src="../../static/images/tech-auth-img3.png" mode=""></image>
			</view>


			<view style="width: 702upx;height: 230upx;margin-left: 24upx;margin-right: 24upx;background: #FFFFFF;border-radius: 24upx;
				position: absolute;top: 75%;">

				<view style="display: flex;flex-direction: column;align-items: center;">
					<image
						style="width: 139upx;height: 139upx;border-radius: 70upx;position: absolute;top: -20%;border: 3upx solid #FFFFFF;"
						:src="userInfo.avatar" mode=""></image>

					<view style="display: flex;flex-direction: row;align-items: center;">
						<view style="color: #191919;font-weight: bold;font-size: 36upx;margin-top: 108upx;">{{userInfo.nickname}}</view>
						<image style="width: 40upx;height: 40upx;margin-top: 108upx;margin-left: 12upx;"
							src="../../static/images/tech-auth-icon.png" v-if="userInfo.isTechAuth===2 || userInfo.isTechAuth===3" mode=""></image>
					</view>

					<view style="display: flex;flex-direction: row;align-items: center;">
						<view style="color: #7A7A7E;font-size: 26upx;margin-top: 12upx;" v-if="userInfo.isTechAuth===1 && !localTechAuth">
							您还没有认证哦</view>
							<view style="color: #7A7A7E;font-size: 26upx;margin-top: 12upx;" v-if="userInfo.isTechAuth===1 && localTechAuth">
								请耐心等待平台审核</view>
						<view style="color: #7A7A7E;font-size: 26upx;margin-top: 12upx;" v-if="userInfo.isTechAuth===2 || userInfo.isTechAuth===3">
							恭喜您，已通过认证</view>
					</view>
					<image style="width: 136upx;height: 104upx;position: absolute;left: 70%;top: 50%;"
						src="../../static/images/tech-authed-icon.png" mode="" v-if="userInfo.isTechAuth===2 || userInfo.isTechAuth===3"></image>

				</view>



			</view>


		</view>

		<view
			style="background: #FFFFFF;width: 702upx;height: 660upx;margin-left: 24upx;margin-right: 24upx;border-radius: 24upx;margin-top: 150upx;">
			<view style="display: flex;flex-direction: column;align-items: center;">
				<view
					style="display: flex;flex-direction: row;justify-content: center;margin-top: 48upx;align-items: center;">
					<image style="width: 36upx;height: 36upx;margin-right: 8upx;"
						src="../../static/images/publish-left-icon.png" mode=""></image>
					<view style="color: #191919;font-size: 32upx;font-weight: bold;">
						技术人员特权
					</view>
					<image style="width: 36upx;height: 36upx;margin-left: 8upx;"
						src="../../static/images/publish-right-icon.png" mode=""></image>
				</view>
				<view style="color: #A6A6A6;font-size: 28upx;margin-top: 24upx;margin-left: 24upx;margin-right: 24upx;">
					认证成为威客字节技术人员，可以无限接单，可以发布源码系统到码市，待平台审核通过后，便可售卖你的源码</view>

			</view>

			<view style="display: flex;flex-direction: column;align-items: center;">
				<view
					style="display: flex;flex-direction: row;justify-content: center;margin-top: 48upx;align-items: center;">
					<image style="width: 36upx;height: 36upx;margin-right: 8upx;"
						src="../../static/images/publish-left-icon.png" mode=""></image>
					<view style="color: #191919;font-size: 32upx;font-weight: bold;">
						技术人员能获得什么
					</view>
					<image style="width: 36upx;height: 36upx;margin-left: 8upx;"
						src="../../static/images/publish-right-icon.png" mode=""></image>
				</view>
				<view style="color: #A6A6A6;font-size: 28upx;margin-top: 24upx;margin-left: 24upx;margin-right: 24upx;">
					获得技术认证身份标识，为您推荐更多需求内容，可以第一时间接单，获得丰厚的接单收益</view>

			</view>


			<view style="display: flex;flex-direction: column;align-items: center;">
				<view
					style="display: flex;flex-direction: row;justify-content: center;margin-top: 48upx;align-items: center;">
					<image style="width: 36upx;height: 36upx;margin-right: 8upx;"
						src="../../static/images/publish-left-icon.png" mode=""></image>
					<view style="color: #191919;font-size: 32upx;font-weight: bold;">
						如何成为技术人员
					</view>
					<image style="width: 36upx;height: 36upx;margin-left: 8upx;"
						src="../../static/images/publish-right-icon.png" mode=""></image>
				</view>
				<view style="color: #A6A6A6;font-size: 28upx;margin-top: 24upx;margin-left: 24upx;margin-right: 24upx;">
					点击“立即认证”，填写自己真实信息，提交申请待平台审核通过后，获得技术认证身份标识，同时邀请你进入对应技术群沟通需求</view>

			</view>
		</view>



		<view style="position: fixed;bottom: 0upx;margin-bottom: 68upx;padding: 0 30upx;" @click="techAuth"
			v-if="userInfo.isTechAuth===1">
			<view style="width: 690upx;height: 80upx;background: #FF4E4C;border-radius: 40upx;
			text-align: center;line-height: 80upx;color: #FFFFFF;">立即认证</view>
		</view>

		<view style="position: fixed;bottom: 0upx;margin-bottom: 68upx;padding: 0 30upx;"
			v-if="userInfo.isTechAuth===2 || userInfo.isTechAuth===3">
			<view style="width: 690upx;height: 80upx;background: #FFFFFF;
		text-align: center;line-height: 80upx;color: #A6A6A6;">已认证，一月仅可修改一次资料</view>
		</view>
		
		<view style="position: fixed;bottom: 0upx;margin-bottom: 68upx;padding: 0 30upx;"
			v-if="localTechAuth && userInfo.isTechAuth===1">
			<view style="width: 690upx;height: 80upx;background: #FFFFFF;
		text-align: center;line-height: 80upx;color: #A6A6A6;">已提交资料，审核中</view>
		</view>

	</view>
</template>

<script>
	import {
		user_info
	} from '../../api/mine/auth.js'
	import {
		set
	} from '../../utils/local.js'
	import {
		get
	} from '../../utils/local.js'
	export default {
		data() {
			return {
				userInfo: {},
				localTechAuth: false
			}
		},
		onShow() {
			this.getUserInfo();
		},
		methods: {
			getUserInfo() {
				// let userInfos = get('userInfo')
				// console.log(userInfos)
				// if (userInfos) {
				// 	this.userInfo = JSON.parse(userInfos)
				// }
				user_info().then(res => {
					console.log(res)
					this.userInfo = res.data
					set('userInfo', JSON.stringify(res.data))
				})
				let localTechAuth = get('localTechAuth')
				if (localTechAuth) {
					this.localTechAuth = true
				}
			},
			techAuth() {
				uni.navigateTo({
					url: '../tech-user-info/tech-user-info'
				})
			}
		}
	}
</script>

<style>

</style>
